package com.atguigu.java;

/**
 * ClassName: Test
 * Description:
 * Date: 2021/2/6 21:24
 * Company: TravelSky
 *
 * @author YangXin
 */
public class Test {

    private static  int num = 1;

    static {
        num = 2;
        number = 20;
        //System.out.println(number); //报错，非法的前向引用
    }

    private static  int number = 10;

    public static void main(String[] args) {

        System.out.println(Test.num);//2
        System.out.println(Test.number);//10

    }
}
